<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('保修单回报')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-repair-edit" th:object="${repairInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">报修内容：</label>
                <div class="col-sm-8">
                    <input name="repairName" th:field="*{repairName}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">设备位置：</label>
                <div class="col-sm-8">
                    <input name="repairLocation" th:field="*{repairLocation}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">报修时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="repairSubmitTime" th:value="${#dates.format(repairInfo.repairSubmitTime, 'yyyy-MM-dd HH:mm:ss')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">报修原因：</label>
                <div class="col-sm-8">
                    <input name="repairReason" th:field="*{repairReason}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">修理类型：</label>
                <div class="col-sm-8">
                    <select name="repairType" class="form-control m-b" th:with="type=${@dict.getType('repair_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{repairType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">报修单状态：</label>
                <div class="col-sm-8">
                    <select name="repairStatus" class="form-control m-b" th:with="type=${@dict.getType('repair_status')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{repairStatus}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">修理结果：</label>
                <div class="col-sm-8">
                    <input name="repairResult" th:field="*{repairResult}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">报修小区：</label>
                <div class="col-sm-8">
                    <select name="courtId" class="form-control m-b" disabled>
                        <option th:each="court : ${courtList}" th:text="${court.courtName}" th:value="${court.id}" th:field="*{courtId}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "property/repair";
        $("#form-repair-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-repair-edit').serialize());
            }
        }

        $("input[name='repairSubmitTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii:ss",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>